import React, { Component } from 'react'

export default class Like extends Component {
    state={
        liked: false
    }

    handle=()=>{
    //    console.log(this.state.liked)
        this.setState({liked:!this.state.liked})
    }
  render() {
      let xihuan = this.state.liked ? '喜欢':'不喜欢'
    return (
      <div>
        <h2 onClick={this.handle}>你{xihuan}我，点我</h2>
      </div>
    )
  }
}
